# Mission 3 Objective 9 - Navigation Challenge # This code uses the safety feature and comments with blank lines. # The movement doesn't have to be an exact square, but it should # be close. Also, the sides can be any length. from botcore import * from time import sleep # Safety feature leds.user(0b00011000) sleep(10) leds.user(0) if buttons.was_pressed(0): motors.enable(True) # first side motors.run(LEFT, 30) motors.run(RIGHT, 30) time.sleep(2) # first turn motors.run(LEFT, -35) motors.run(RIGHT, 35) sleep(0.55) # second side motors.run(LEFT, 30) motors.run(RIGHT, 30) time.sleep(2) # second turn motors.run(LEFT, -35) motors.run(RIGHT, 35) sleep(0.55) # third side motors.run(LEFT, 30) motors.run(RIGHT, 30) time.sleep(2) # third turn motors.run(LEFT, -35) motors.run(RIGHT, 35) sleep(0.55) # fourth side motors.run(LEFT, 30) motors.run(RIGHT, 30) time.sleep(2) # fourth turn -- optional motors.run(LEFT, -35) motors.run(RIGHT, 35) sleep(0.55)